$(function () {
    //前端验证开始
    $(function(){
    	   $.validator.setDefaults({
	   debug: true
	})
    	   
//  	 var validatorArr = ["zhai-quan","lawsuit_borrower_edit","stakeholder_borrower_edit","lawsuit_warrantor_edit","stakeholder_warrantor_readonly","stakeholder_pledger_readonly","lawsuit_other_readonly"]  ;
		 var validatorArr = ["zhai-quan"]  ;
    	
    	for(var i = 0; i < validatorArr.length; i++){
    		var str = validatorArr[i];
    		$("#"+ str).validate({});
    	}
    })
    //前端验证结束 
	
	
    var host = $('#host').val();

    // var data = [{id: 1, text: '工业用地'}, {id: 2, text: '住宅'}, {id: 3, text: '住宅用地'}, {id: 4, text: '办公房产'},
    //     {id: 5, text: '商业房产'}, {id: 6, text: '商业用地'}, {id: 7, text: '设备'}, {id: 8, text: '股票'}, {id: 8, text: '其他'}];//下拉列表中的数据项
    var data = [{id: 1, text: '房产'}, {id: 2, text: '土地'}, {id: 3, text: '林矿'}, {id: 4, text: '交通运输'},
         {id: 5, text: '机械设备'}, {id: 6, text: '股权'}, {id: 7, text: '无形资产'}, {id: 8, text: '其他资产'}];//下拉列表中的数据项


    $("#select1").select2({
        data: data,
        placeholder: '请选择',
        //选中后的关闭按钮
        allowClear: true
    });//启动select2
    // 上方公共样式切换按钮
    // 基本情况-尽调评估-审核情况-操作日志 切换按钮
    $(".edit-tabs-li1").click(function () {
        $(this).addClass("active").children(".edit-tabs-ul2").show();
        $(this).siblings().removeClass("active").children(".edit-tabs-ul2").hide();

    });
    // 关注-下载报告-发起协同 切换按钮
    $(".details-btn").click(function () {
        $(this).addClass("btn-primary").siblings().removeClass("btn-primary").addClass("btn-default");
    });

    // 4.项目清单表格右上方切换按钮
    $(".notedit-nav-ul-guarantee li").click(function () {
        $(this).addClass("active").siblings().removeClass("active");
    });
    $(".notedit-nav-ul-guaranty li").click(function () {
        $(this).addClass("active").siblings().removeClass("active");
    });

    // 只显示亮点项目
    $(".table-foot-turn").click(function () {
        if ($(this).find('img').attr('src') == host + '/image/assetPackage/turn.png') {
            $(this).find('img').attr('src', host + '/image/assetPackage/turnoff.png');
        } else {
            $(this).find('img').attr('src', host + '/image/assetPackage/turn.png');
        }
    });
    $('.myActiveBox').on('click', 'li', function () {
        $(this).addClass("myActive").siblings().removeClass('myActive')
    })

    /*<!--<!--尽调9+1附件-->*/
    $('.jinTiao91 .pull-right').on('click', 'span', function () {
        $(this).addClass("jinTiao91Active").siblings().removeClass("jinTiao91Active")
    })

//	单击编辑image/projectDetails/save.png
    $('.jinTiao91 form table').on('click', '.tableEdit', function () {
        if ($(this).hasClass('edit-tab')) {
            $(this).attr('title', '保存')
            $(this).attr('src', host + '/image/projectDetails/save.png').removeClass('edit-tab');
            $(this).parent().parent().parent().find('input[class="table-text"]').removeAttr('readonly').css({
                'border': '1px solid #D6D6D6'
            });
            $(this).parent().parent().parent().find('select[id="table-select"]').removeAttr('disabled').removeClass('select-sanjiao');
        } else {
            $(this).attr('title', '编辑')
            $(this).attr('src', host + '/image/projectDetails/tableEdit.png').addClass('edit-tab');
            $(this).parent().parent().parent().find('input[class="table-text"]').prop('readonly', 'true').css({
                'border': '1px solid  transparent'
            });
            $(this).parent().parent().parent().find('select[id="table-select"]').prop('disabled', 'true').addClass('select-sanjiao');
        }

    })
    //所属行业和抵押物类型样式切换
    $('.jiBenXinXi .labelActiveBox').on('click', 'label', function () {
        $(this).toggleClass('labelActive');
    })
    $('.suSongZhuangTai strong').on('click', 'label', function () {
        // 获取当前label对应input的值
        var str = $(this).attr('for')
        $(this).children('i').addClass('radioActive');
        $(this).siblings('label').children('i').removeClass('radioActive');
    })

    //	上传附件 遮罩层的取消和 确定按钮样式切换
    $('.cancelInConfirm').on('click', 'input', function () {
        $(this).addClass('active').siblings('input').removeClass('active');
    })
//	单击上传附件遮罩层中的上传失败关闭按钮
    $('.fileBox').on('click', '.closImg', function () {
        $(this).parent().parent().remove()
    })

    //流转input聚焦和失去焦点
    $('.liuZhuan form table input[type="text"]').focus(function () {
        $(this).css({
            'border': '1px solid #333'
        })
    })

    $('.liuZhuan form table input[type="text"]').blur(function () {
        $(this).css({
            'border': '1px solid  #d6d6d6'
        })
    })

    //单击抵押人中的涉诉情况删除图标
    var shesu = false;
    var shesuThis;
    $('.suSongQingKuang').on('click', 'input[class="remove"]', function () {
        shesu = true;
        shesuThis = this;
    })
    //单击	模态框中确定modal-cancel
    $('#deleModal .modal-footer').on('click', '#modal-cancel', function () {
        if (b) {

            $(th).parent().parent().parent().remove();
        }
        if (shesu) {
            $(shesuThis).parent().parent().remove();
        }
    })
    //	点击和删除
    //单击全选input
    $('.jinTiao91 form table input[class="whole"]').on('click', function () {
        if ($(this).is(':checked')) {
            $(this).parent().parent().siblings().find('input').prop('checked', true);

        } else {
            $(this).parent().parent().siblings().find('input').prop('checked', false);
        }
    })
    //点击单个input
    $('.jinTiao91 form table tr td input[type="checkbox"]').on('click', function () {
        var index = $(this).parent().parent().siblings().length;
        var b = true;
        for (var i = 1; i <= index; i++) {
            if (!$('.jinTiao91 table tr').eq(i).find('td').find('input[type="checkbox"]').is(":checked")) {
                b = false;
                $('.whole').prop('checked', false);
            }
        }
        if (b) {
            $('.whole').prop('checked', true);
        }
    })

    //头部交互逻辑
    //头部交互效果   滚动定位 ,锚链接和一键置顶开始
    $(document).on('scroll', function () {
//		if(getScrollTop() < scroll) {
//			$(href).removeClass('hrefTop')
//		}

        //一键置顶
        if ($(window).height() < getScrollTop()) {
            $('.clicktop').show();
        } else {
            $('.clicktop').hide();
        }
//        动态添加导航背景色
        var idList = ["zhaiQuan", "jieKuan", "baoZheng", "diYa", "qiTa", "zongJie", "fuJian", "zongJie"];
        for (var i = 0; i < idList.length; i++) {
            var id = idList[i];
            var top = $('#' + id).offset().top - getScrollTop();
            var str = -($('#' + id).height() + 118);
            if (top < 118 && top > str) {
                $('.zhaiQuanTable li').eq(i).addClass('myActive').siblings().removeClass('myActive');
            }
        }


        //	获取滚动条到顶部的垂直高度 ：

        /*if(getScrollTop()>330){
         $('.navFix').addClass('tableFixe').next().addClass('navFixNext');
         $('.edit-tabs-ul1').addClass('edit-tabs-ul1Fixe')*/

    })

    //锚链接样式
    $('.myActiveBox li').on('click', 'a', function () {
        var href = $(this).attr('data-href');
        $("html,body").animate({scrollTop: $(href).offset().top - 110}, {duration: 1, easing: "swing"});
    })


    /**
     *
     * @return 支持IE6
     */
    function getScrollTop() {
        var scrollPos;
        if (window.pageYOffset) {
            scrollPos = window.pageYOffset;
        } else if (document.compatMode && document.compatMode != 'BackCompat') {
            scrollPos = document.documentElement.scrollTop;
        } else if (document.body) {
            scrollPos = document.body.scrollTop;
        }
        return scrollPos;
    }

    //显示遮罩层
    function showMask() {
        $("#mask").css("height", $(document).height());
        $("#mask").css("width", $(document).width());
        $("#mask").show();
    }

    //隐藏遮罩层  
    function hideMask() {
        $("#mask").hide();
    }

    // //编辑部分开始
    //var editImg = true;
    // //单击编辑
    // $('.editImg').on('click', function () {
    //     if (editImg) {
    //         $(this).hide();
    //         $(this).parent().parent().parent().next().hide();
    //         $(this).parent().parent().parent().next().next().show();
    //     }
    //     editImg = false;
    //
    // })

    $('.myActiveBox').on('click', 'li', function () {
        $(this).addClass("myActive").siblings().removeClass('myActive')
    })

    $('.edit-tabs-ul2').on('click', 'li', function () {
        $(this).addClass("myActive").siblings().removeClass('myActive')
    })


    /*<!--<!--尽调9+1附件-->*/
    $('.jinTiao91 .pull-right').on('click', 'span', function () {
        $(this).addClass("jinTiao91Active").siblings().removeClass("jinTiao91Active")
    })


    //列失信

    $('.labelRowline input[type="radio"]').on('click', function () {
        $(this).prev().addClass('yesActive').removeClass('noActive');
        $(this).parent().siblings().find('span').removeClass('yesActive').addClass('noActive');
    })

    //<!--抵押人及抵押物情况-->

    //所属行业和抵押物类型样式切换
    $('.jiBenXinXi .labelActiveBox').on('click', 'label', function () {
        $(this).toggleClass('labelActive');
    })
    $('.suSongZhuangTai strong').on('click', 'label', function () {
        // 获取当前label对应input的值
        var str = $(this).attr('for')
        $(this).children('i').addClass('radioActive');
        $(this).siblings('label').children('i').removeClass('radioActive');
    })
    //	取消和保存按钮样式切换
    $('.cancelInConfirm').on('click', 'input', function () {
        //editImg = true;
        $('.project_edit_state').val(1);
        $(this).addClass('cancelInConfirmActive').siblings('input').removeClass('cancelInConfirmActive');
    })
    /*//单击取消
     $('.cancelInConfirm').on('click', '#cancel', function () {
     $(this).parent().parent().hide().prev().show().prev().find('img').show();
     })*/
    /*//单击确定
     $('.cancelInConfirm').on('click', '#confirm', function () {
     $(this).parent().parent().hide().prev().show().prev().find('img').show();
     })*/

    //流转input聚焦和失去焦点
    $('.liuZhuan form table input[type="text"]').focus(function () {
        $(this).css({
            'border': '1px solid #333'
        })
    })
    $('.liuZhuan form table input[type="text"]').blur(function () {
        $(this).css({
            'border': '1px solid  #d6d6d6'
        })
    })

//     var c = false;
//     var thi;
//     $('.she-su-qing-kuang-edit').on('click', 'tr td input[type = "button"]', function () {
//         c = true;
//         thi = this;
//     })
//     //单击	模态框中确定modal-cancel
//     $('#deleModal .modal-footer').on('click', '#modal-cancel', function () {
//         if (c) {
//
//             $(thi).parent().parent().remove();
//         }
//     })

    //单击全选input
    $('.jinTiao91 form table input[class="whole"]').on('click', function () {
        if ($(this).is(':checked')) {
            $(this).parent().parent().siblings().find('input').prop('checked', true);

        } else {
            $(this).parent().parent().siblings().find('input').prop('checked', false);
        }
    })
    //点击单个input
    $('.jinTiao91 form table tr td input[type="checkbox"]').on('click', function () {
        var index = $(this).parent().parent().siblings().length;
        var b = true;
        for (var i = 1; i <= index; i++) {
            if (!$('.jinTiao91 table tr').eq(i).find('td').find('input[type="checkbox"]').is(":checked")) {
                b = false;
                $('.whole').prop('checked', false);
            }
        }
        if (b) {
            $('.whole').prop('checked', true);
        }
    })


    /*---------------------------  编辑加锁 zhao shou qiang  ----------------------------*/
    var project_id = $('#project_id').val(),
        lock_url = $('#investigation_lock_url').val(),
        stakeholder_lock_url = $('#investigation_stakeholder_lock_url').val(),
        lawsuit_lock_url = $('#investigation_lawsuit_lock_url').val();

    //债权基本情况编辑加锁
    $('#zhaiQuan').on('click', '.editImg', function () {
        var id = $('#investigation_id1').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            set_investigation_locking({id: id, project_id: project_id, type: 1}, lock_url, $(this));
        } else if(editImg == 2) {
            layer.msg('有编辑页面未保存');
        }
        //editImg = false;
    })

    //尽调总结编辑加锁
    $('#zongJie').on('click', '.editImg', function () {
        var id = $('#investigation_id1').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            set_investigation_locking({id: id, project_id: project_id, type: 1}, lock_url, $(this));
        } else if(editImg == 2) {
            layer.msg('有编辑页面未保存');
        }
        //editImg = false;
    })

    //借款人及资产情况加锁 如果是涉诉情况则请求另一个地址lawsuit_lock_url
    $('#jieKuan').on('click', '.editImg', function (){
        var id = $('#stakeholder_borrower_id').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            if ($(this).hasClass('lawsuitImg')) {
                set_investigation_lawsuit_locking({stakeholder_id: id, project_id: project_id, type: 1}, lawsuit_lock_url, $(this));
            } else {
                set_investigation_stakeholder_locking({id: id, project_id: project_id, type: 1, stakeholder_type: 1}, stakeholder_lock_url, $(this));
            }
        } else if(editImg == 2) {
            layer.msg('有编辑页面未保存');
        }
        //editImg = false;
    })

    //抵押人及资产情况加锁
    $('#diYa').on('click', '.editImg', function (){
        var id = $('#stakeholder_pledger_id').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            if ($(this).hasClass('lawsuitImg')) {
                set_investigation_lawsuit_locking({stakeholder_id: id, project_id: project_id, type: 1}, lawsuit_lock_url, $(this));
            } else {
                set_investigation_stakeholder_locking({id: id, project_id: project_id, type: 1, stakeholder_type: 2}, stakeholder_lock_url, $(this));
            }
        } else if(editImg == 2) {
            layer.msg('有编辑页面未保存');
        }
        //editImg = false;
    })

    //保证人及资产情况加锁
    $('#baoZheng').on('click', '.editImg', function (){
        var id = $('#stakeholder_warrantor_id').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            if ($(this).hasClass('lawsuitImg')) {
                set_investigation_lawsuit_locking({stakeholder_id: id, project_id: project_id, type: 1}, lawsuit_lock_url, $(this));
            } else {
                set_investigation_stakeholder_locking({id: id, project_id: project_id, type: 1, stakeholder_type: 3}, stakeholder_lock_url, $(this));
            }
        } else if(editImg == 2) {
            layer.msg('有编辑页面未保存');
        }
        //editImg = false;
    })

    //其他承债人及资产情况加锁
    $('#qiTa').on('click', '.editImg', function (){
        var id = $('#stakeholder_other_id').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            if ($(this).hasClass('lawsuitImg')) {
                set_investigation_lawsuit_locking({stakeholder_id: id, project_id: project_id, type: 1}, lawsuit_lock_url, $(this));
            } else {
                set_investigation_stakeholder_locking({id: id, project_id: project_id, type: 1, stakeholder_type: 4}, stakeholder_lock_url, $(this));
            }
        } else if(editImg == 2) {
            layer.msg('有编辑页面未保存');
        }
        //editImg = false;
    })


    /*---------------------------  点击取消承债人解锁 zhao shou qiang  ----------------------------*/
    //借款人及资产情况解锁
    $('#jieKuan .cancelInConfirm').on('click', '#cancel', function (){
        var id = $('#stakeholder_borrower_id').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            set_investigation_stakeholder_unlocking({id: id, project_id: project_id, type: 2, stakeholder_type: 1}, stakeholder_lock_url, $(this));
        }
    })

    //抵押人及资产情况解锁
    $('#diYa .cancelInConfirm').on('click', '#cancel', function (){
        var id = $('#stakeholder_pledger_id').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            set_investigation_stakeholder_unlocking({id: id, project_id: project_id, type: 2, stakeholder_type: 2}, stakeholder_lock_url, $(this));
        }
    })

    //保证人及资产情况解锁
    $('#baoZheng .cancelInConfirm').on('click', '#cancel', function (){
        var id = $('#stakeholder_warrantor_id').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            set_investigation_stakeholder_unlocking({id: id, project_id: project_id, type: 2, stakeholder_type: 3}, stakeholder_lock_url, $(this));
        }
    })

    //其它承债人及资产情况解锁
    $('#qiTa .cancelInConfirm').on('click', '#cancel', function (){
        var id = $('#stakeholder_other_id').val();
        var editImg = $('.project_edit_state').val();
        if (editImg == 1) {
            set_investigation_stakeholder_unlocking({id: id, project_id: project_id, type: 2, stakeholder_type: 4}, stakeholder_lock_url, $(this));
        }
    })

})


function set_investigation_stakeholder_unlocking(param, url, obj) {
    $.ajax({
        type: "POST",
        url: url,
        data: param,
        datatype: "json",
        success: function (data) {
            if (data.code == 200) {
                obj.parent().parent().hide().prev().show().prev().find('img').show();
                switch (param.stakeholder_type) {
                    //借款人
                    case 1:
                        var jieKuan_step3_state = $('#jieKuan').find('.step3_state').val(),
                            jieKuan_step4_state = $('#jieKuan').find('.step4_state').val(),
                            jieKuan_step5_state = $('#jieKuan').find('.step5_state').val(),
                            jieKuan_step6_state = $('#jieKuan').find('.step6_state').val(),
                            jieKuan_step7_state = $('#jieKuan').find('.step7_state').val();
                        $('#jieKuan').find('.step3_nothing').text('');
                        $('#jieKuan').find('.step4_nothing').text('');
                        $('#jieKuan').find('.step5_nothing').text('');
                        $('#jieKuan').find('.step6_nothing').text('');
                        $('#jieKuan').find('.step7_nothing').text('');
                        if (jieKuan_step3_state ==2) {
                            $('#jieKuan').find('.step3_nothing').text('（暂无数据）');
                            $('#jieKuan').find('.step3_nothing').parent().parent().next().hide();
                        }
                        if (jieKuan_step4_state ==2) {
                            $('#jieKuan').find('.step4_nothing').text('（暂无数据）');
                            $('#jieKuan').find('.step4_nothing').parent().parent().next().hide();
                        }
                        if (jieKuan_step5_state ==2) {
                            $('#jieKuan').find('.step5_nothing').text('（暂无数据）');
                            $('#jieKuan').find('.step5_nothing').parent().parent().next().hide();
                        }
                        if (jieKuan_step6_state ==2) {
                            $('#jieKuan').find('.step6_nothing').text('（暂无数据）');
                            $('#jieKuan').find('.step6_nothing').parent().parent().next().hide();
                        }
                        if (jieKuan_step7_state ==2) {
                            $('#jieKuan').find('.step7_nothing').text('（暂无数据）');
                            $('#jieKuan').find('.step7_nothing').parent().parent().next().hide();
                        }
                        break;

                    //保证人
                    case 2:
                        var diYa_step1_state = $('#diYa').find('.step1_state').val(),
                            diYa_step3_state = $('#diYa').find('.step3_state').val(),
                            diYa_step5_state = $('#diYa').find('.step5_state').val(),
                            diYa_step6_state = $('#diYa').find('.step6_state').val(),
                            diYa_step7_state = $('#diYa').find('.step7_state').val();
                        $('#diYa').find('.step1_nothing').text('');
                        $('#diYa').find('.step3_nothing').text('');
                        $('#diYa').find('.step5_nothing').text('');
                        $('#diYa').find('.step6_nothing').text('');
                        $('#diYa').find('.step7_nothing').text('');
                        if (diYa_step1_state ==2) {
                            $('#diYa').find('.step1_nothing').text('（暂无数据）');
                            $('#diYa').find('.step1_nothing').parent().parent().next().hide();
                        }
                        if (diYa_step3_state ==2) {
                            $('#diYa').find('.step3_nothing').text('（暂无数据）');
                            $('#diYa').find('.step3_nothing').parent().parent().next().hide();
                        }
                        if (diYa_step5_state ==2) {
                            $('#diYa').find('.step5_nothing').text('（暂无数据）');
                            $('#diYa').find('.step5_nothing').parent().parent().next().hide();
                        }
                        if (diYa_step6_state ==2) {
                            $('#diYa').find('.step6_nothing').text('（暂无数据）');
                            $('#diYa').find('.step6_nothing').parent().parent().next().hide();
                        }
                        if (diYa_step7_state ==2) {
                            $('#diYa').find('.step7_nothing').text('（暂无数据）');
                            $('#diYa').find('.step7_nothing').parent().parent().next().hide();
                        }
                        break;

                    //抵押人
                    case 3:
                        var baoZheng_step1_state = $('#baoZheng').find('.step1_state').val(),
                            baoZheng_step3_state = $('#baoZheng').find('.step3_state').val(),
                            baoZheng_step5_state = $('#baoZheng').find('.step5_state').val(),
                            baoZheng_step6_state = $('#baoZheng').find('.step6_state').val(),
                            baoZheng_step7_state = $('#baoZheng').find('.step7_state').val();
                        $('#baoZheng').find('.step1_nothing').text('');
                        $('#baoZheng').find('.step3_nothing').text('');
                        $('#baoZheng').find('.step5_nothing').text('');
                        $('#baoZheng').find('.step6_nothing').text('');
                        $('#baoZheng').find('.step7_nothing').text('');
                        if (baoZheng_step1_state ==2) {
                            $('#baoZheng').find('.step1_nothing').text('（暂无数据）');
                            $('#baoZheng').find('.step1_nothing').parent().parent().next().hide();
                        }
                        if (baoZheng_step3_state ==2) {
                            $('#baoZheng').find('.step3_nothing').text('（暂无数据）');
                            $('#baoZheng').find('.step3_nothing').parent().parent().next().hide();
                        }
                        if (baoZheng_step5_state ==2) {
                            $('#baoZheng').find('.step5_nothing').text('（暂无数据）');
                            $('#baoZheng').find('.step5_nothing').parent().parent().next().hide();
                        }
                        if (baoZheng_step6_state ==2) {
                            $('#baoZheng').find('.step6_nothing').text('（暂无数据）');
                            $('#baoZheng').find('.step6_nothing').parent().parent().next().hide();
                        }
                        if (baoZheng_step7_state ==2) {
                            $('#baoZheng').find('.step7_nothing').text('（暂无数据）');
                            $('#baoZheng').find('.step7_nothing').parent().parent().next().hide();
                        }
                        break;

                    //其他承债人
                    case 4:
                        var qiTa_step1_state = $('#qiTa').find('.step1_state').val(),
                            qiTa_step3_state = $('#qiTa').find('.step3_state').val(),
                            qiTa_step5_state = $('#qiTa').find('.step5_state').val(),
                            qiTa_step6_state = $('#qiTa').find('.step6_state').val(),
                            qiTa_step7_state = $('#qiTa').find('.step7_state').val();
                        $('#qiTa').find('.step1_nothing').text('');
                        $('#qiTa').find('.step3_nothing').text('');
                        $('#qiTa').find('.step5_nothing').text('');
                        $('#qiTa').find('.step6_nothing').text('');
                        $('#qiTa').find('.step7_nothing').text('');
                        if (qiTa_step1_state ==2) {
                            $('#qiTa').find('.step1_nothing').text('（暂无数据）');
                            $('#qiTa').find('.step1_nothing').parent().parent().next().hide();
                        }
                        if (qiTa_step3_state ==2) {
                            $('#qiTa').find('.step3_nothing').text('（暂无数据）');
                            $('#qiTa').find('.step3_nothing').parent().parent().next().hide();
                        }
                        if (qiTa_step5_state ==2) {
                            $('#qiTa').find('.step5_nothing').text('（暂无数据）');
                            $('#qiTa').find('.step5_nothing').parent().parent().next().hide();
                        }
                        if (qiTa_step6_state ==2) {
                            $('#qiTa').find('.step6_nothing').text('（暂无数据）');
                            $('#qiTa').find('.step6_nothing').parent().parent().next().hide();
                        }
                        if (qiTa_step7_state ==2) {
                            $('#qiTa').find('.step7_nothing').text('（暂无数据）');
                            $('#qiTa').find('.step7_nothing').parent().parent().next().hide();
                        }
                        break;
                    default:
                }
                $('.project_edit_state').val(1);
            } else if (data.code == 400) {
                layer.msg(data.message);
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            layer.msg('系统错误');
        }
    })
}

function set_investigation_lawsuit_locking(param, url, obj) {
    $.ajax({
        type: "POST",
        url: url,
        data: param,
        datatype: "json",
        success: function (data) {
            if (data.code == 200) {
                obj.hide();
                obj.parent().parent().parent().next().hide();
                obj.parent().parent().parent().next().next().show();
                $('.project_edit_state').val(2);
            } else if (data.code == 400) {
                layer.msg(data.message);
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            layer.msg('系统错误');
        }
    })
}

function set_investigation_stakeholder_locking(param, url, obj) {
    $.ajax({
        type: "POST",
        url: url,
        data: param,
        datatype: "json",
        success: function (data) {
            if (data.code == 200) {
                obj.hide();
                obj.parent().parent().parent().next().hide();
                obj.parent().parent().parent().next().next().show();
                $('.project_edit_state').val(2);
            } else if (data.code == 400) {
                layer.msg(data.message);
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            layer.msg('系统错误');
        }
    })
}

	


//债权基本情况编辑加锁 project_investigation
function set_investigation_locking(param, url, obj) {
    $.ajax({
        type: "POST",
        url: url,
        data: param,
        datatype: "json",
        success: function (data) {
            if (data.code == 200) {
                obj.hide();
                obj.parent().parent().parent().next().hide();
                obj.parent().parent().parent().next().next().show();
                $('.project_edit_state').val(2);
            } else if (data.code == 400) {
                layer.msg(data.message);
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            layer.msg('系统错误');
        }
    })
}




